<admintpl file="header"/>

<style>
    .imgs {
        margin-left: 5px;
    }

    .display_none {
        display: none;
    }
</style>
</head>
<script type="text/html" id="photos-item-wrapper">
    <li id="savedimage{id}">
        <input id="photo-{id}" type="hidden" name="photos_url[]" value="{filepath}">
        <input id="photo-{id}-name" type="text" name="photos_alt[]" value="{name}" style="width: 160px;" title="图片名称">
        <img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"
             onclick="parent.image_preview_dialog(this.src);">
        <a href="javascript:upload_one_image('图片上传','#photo-{id}');">替换</a>
        <a href="javascript:$('#savedimage{id}').remove();">移除</a>
    </li>
</script>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <!--<li><a href="{:U('Info/lists', ['tag' => $tag])}" target="_self">列表</a></li>-->
        <li class="active"><a href="javascript:;">编辑</a></li>
    </ul>
    <form action="{:U('edit')}" method="post" class="form-horizontal"
          enctype="multipart/form-data">
        <div class="row-fluid">
            <div class="span10">
                <input type="hidden" name="post[tag]" value="{$tag}">
                <input type="hidden" name="post[id]" value="{$id}">
                <table class="table table-bordered">
                    <if condition="$tag eq 'news'">
                        <tr>
                            <th style="width: 100px;">类型：</th>
                            <td>

                                <select style="" id="" name="post[type]">
                                    <!--<option value="0">&#45;&#45;请选择&#45;&#45;</option>-->
                                    {$options}
                                </select>
                            </td>
                        </tr>
                    </if>


                    <tr>
                        <th style="white-space:nowrap;">标题：</th>
                        <td><input type="text" name="post[title]" required id="name" value="{$title}" style="width: 400px">
                            <span class="form-required">*</span>
                        </td>
                    </tr>
                    <tr>
                        <th style="white-space:nowrap;">虚拟阅读量：</th>
                        <td><input type="text" name="post[virtual]" required id="" value="{$virtual}" style="width: 400px">
                            <span class="form-required">*</span>
                        </td>
                    </tr>
                    <tr>
                        <th style="white-space:nowrap;">来源：</th>
                        <td><input type="text" name="post[source]" required id="" value="{$source}" style="width: 400px">
                            <span class="form-required">*</span>
                        </td>
                    </tr>
                    <tr id="thirdparty" class="">
                        <th style="white-space:nowrap;">封面图(170*170)：</th>
                        <td>
                            <input type="hidden" name="post[cover]" required id="thumb" value="{$cover}">
                            <a href="javascript:upload_one_image('图片上传','#thumb');"> <img
                                    src="<eq name='cover' value=''>__ROOT__/themes/simplebootx/Public/assets/images/default-thumbnail.png<else/>{$cover|setUrl}</eq>"
                                    id="thumb-preview" width="150" style="cursor: hand">
                            </a> <input type="button" class="btn btn-small"
                                        onclick="$('#thumb-preview').attr('src','/hospital/admin/themes/simplebootx/Public/assets/images/default-thumbnail.png');$('#thumb').val('');return false;"
                                        value="取消图片">
                        </td>
                    </tr>
                    <tr>
                        <th style="white-space:nowrap;">内容简介：</th>
                        <td><textarea rows="5" cols="30" name="post[discribe]" required>{$discribe}</textarea>
                            <span class="form-required">*</span>
                        </td>
                    </tr>


                    <tr>
                        <th>描述详情</th>
                        <td>
                            <script type="text/plain" id="content" name="post[content]"
                                    style="width:80%x;height:500px;"></script>
                            </td>
                            </tr>


                            </table>
                            </div>
                            </div>
                            <button class="btn btn-primary js-ajax-submit" type="submit">提交</button>
                                <a class="btn" href="javascript:history.back(-1);">返回</a>
                                </form>
                                </div>
                                </body>
                                <script src="__PUBLIC__/js/jquery.js"></script>
                            <script src="__PUBLIC__/js/common.js"></script>
                            <script type="text/javascript" src="__PUBLIC__/js/content_addtop.js"></script>
                            <script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.config.js"></script>
                            <script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.all.min.js"></script>
                            <script>
                                $(function () {
                                    var ue = UE.getEditor('content', {
                                        autoHeight: false,
                                        autoHeightEnabled: false, //出现滚动条
                                        elementPathEnabled: false  //去掉元素路径

                                    });
                                    //对编辑器的操作最好在编辑器ready之后再做
                                    ue.ready(function () {
                                        //设置编辑器的内容
                                        ue.setContent('{$content}');
                                        //获取html内容，返回: <p>hello</p>d
                                    });
                                });

                            </script>
                            </html>